package br.ufrpe.bsi.pvs.database;

import java.sql.Connection;
import java.sql.DriverManager;

/**
 * Classe respons�vel pela conexao com o banco de dados.
 *
 */
public class Conexao {

	private static String status = "Conexao nao estabelecida";

	private static final String driver = "com.mysql.jdbc.Driver";
	private static final String link = "jdbc:mysql://127.0.0.1/pvs";
	private static final String usuario = "root";
	private static final String senha = "";

	private static Connection conexao = null;

	static public Connection getConnection() {

		try {
			Class.forName(driver);
			conexao = DriverManager.getConnection(link, usuario, senha);
			status = "Conexao estabelecida";
		} catch (Exception e) {
			e.printStackTrace();
		}

		return conexao;
	}

	public static String getStatus() {
		return status;
	}

}
